' Since VB doesn't support passing 'void' pointers -- we have to trick it to do the job
' SeekS is for STRINGS
' SeekO is for anything else...
Declare Function mfSeekS& Lib "mf.dll" Alias "mfSeek" (ByVal skStr$, retcode%, ByVal task%, ByVal dbHndl%, ByVal xNum%)
Declare Function mfSeekO& Lib "mf.dll" Alias "mfSeek" (skStr As Any, retcode%, ByVal task%, ByVal dbHndl%, ByVal xNum%)
' Severe-Performance functions
Declare Function mfReadListS& Lib "mf.dll" Alias "mfReadList" (ByVal record As Long, ByVal skStr$, ByVal FuzzyLength%, hitList As Any, ByVal maxHits&, ByVal task%, ByVal dbHndl%, ByVal xNum%)
Declare Function mfReadListO& Lib "mf.dll" Alias "mfReadList" (ByVal record As Long, skStr As Any, ByVal FuzzyLength%, hitList As Any, ByVal maxHits&, ByVal task%, ByVal dbHndl%, ByVal xNum%)
Declare Function mfReadListNull& Lib "mf.dll" Alias "mfReadList" (ByVal record As Long, ByVal skStr As Long, ByVal FuzzyLength%, hitList As Any, ByVal maxHits&, ByVal task%, ByVal dbHndl%, ByVal xNum%)
' Constants:
' READ and WRITE options
Global Const MFRW_ALL = -1
Global Const MFRW_DATA = -2
Global Const MFRW_KEY = -3
' Seek Top/Bottom
' Return codes when there's no higher/lower key
' or no data at all...
Global Const MFSEEK_BOF = -1
Global Const MFSEEK_EOF = -2
Global Const MFSEEK_NODATA = -3
' parameter set in iCode for an mfSeek
Global Const MFSEEK_EXACT_MATCH = 1
Global Const MFSEEK_PARTIAL_MATCH = 2
' SP constants
Global Const MF_SP_COUNT = -1
' index type information
Global Const MFCOMP_CHAR = 1
Global Const MFCOMP_INT = 2
Global Const MFCOMP_LONG = 3
Global Const MFCOMP_CHARIC = 4 ' Case insensitive strings
Global Const MFCOMP_UDK = 100 ' Or greater...
' used for an array on index sizes on createDB
Type tIntArray
i As Integer
End Type
' Used for getting a hit-list in the severe-performance functions
Type tLongArray
l As Long
End Type
' Required on mfInit when using extensions to MF
Type tExtDLL
type As Integer
DLLName As String * 128
End Type
' Need 1 task handle per application instance
Global TaskHndl As Integer ' Task handle # for this instance
Sub mfBeginRun ()
ReDim extDLLs(0 To 1) As tExtDLL
extDLLs(0).type = MFCOMP_UDK ' tells mf to use this dll for UDK's
extDLLs(0).DLLName = "mfUDK.dll"
extDLLs(1).type = -1 ' tells MF there are NO more extensions to load
' Add this line as the first line in your application
' (or, at least before you use the dbms)
' The TaskHndl is your unique handle to the database
' If the hndl is -1, then 10 apps are already accessing the
' database -- close some!
TaskHndl = mfInit(extDLLs(0))
If TaskHndl < 0 Then
MsgBox "No database handles available -- please close some active windows"
End
End If
End Sub
' Call when you are completely done with the database